< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03020412.xhp

(section: name) (bookmark: bm_id3143268)
Name statement

Name; ステートメント

Name Statement [Runtime]
Name ステートメント [実行時](hd_id3143268.1)

Renames an existing file or directory.
既存のファイルおよびディレクトリの名前を変更します。(par_id3154346.2)

(/section: name)

Syntax:
構文:(hd_id3156344.3)

Name OldName As String As NewName As String
Name OldName As String As NewName As String(par_id3153381.4)

Parameters:
パラメータ:(hd_id3153362.5)

OldName, NewName: Any string expression that specifies the file name, including the path. You can also use URL notation.
OldName, NewName: ファイル名およびパスを指定する文字列表式。またURL 指定を用いることもできます。(par_id3151210.6)

Example:
例:(hd_id3125863.8)

Sub ExampleReName
Sub ExampleReName(par_id3145786.9)

On Error Goto Error
On Error Goto Error(par_id3161832.10)

Filecopy "c:\autoexec.bat", "c:\temp\autoexec.sav"
Filecopy "c:\autoexec.bat", "c:\temp\autoexec.sav"(par_id3147435.11)

Name "c:\temp\autoexec.sav" as "c:\temp\autoexec.bat"
"c:\temp\autoexec.sav" の名前を "c:\temp\autoexec.bat" とします。(par_id3156444.12)

end
End(par_id3155308.13)

Error:
Error:(par_id3153727.14)

if err = 58 then
if err = 58 then(par_id3153951.15)

msgbox "File already exists"
msgbox "File already exists"(par_id3152462.16)

end if
end if(par_id3149263.17)

end
End(par_id3154011.18)

end sub
end sub(par_id3146985.19)


< Prev / Next >